package cn.iocoder.yudao.module.member.dal.mysql.deliverypersoninfo;


import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.deliverypersoninfo.DeliveryPersonInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.deliverypersoninfo.vo.*;

/**
 * 配送员信息扩展 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface DeliveryPersonInfoMapper extends BaseMapperX<DeliveryPersonInfoDO> {

    default PageResult<DeliveryPersonInfoDO> selectPage(DeliveryPersonInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeliveryPersonInfoDO>()
                .eqIfPresent(DeliveryPersonInfoDO::getCode, reqVO.getCode())
                .likeIfPresent(DeliveryPersonInfoDO::getName, reqVO.getName())
                .eqIfPresent(DeliveryPersonInfoDO::getMobile, reqVO.getMobile())
                .eqIfPresent(DeliveryPersonInfoDO::getAvatar, reqVO.getAvatar())
                .eqIfPresent(DeliveryPersonInfoDO::getVehicleId, reqVO.getVehicleId())
                .eqIfPresent(DeliveryPersonInfoDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(DeliveryPersonInfoDO::getGender, reqVO.getGender())
                .eqIfPresent(DeliveryPersonInfoDO::getEmployeeCardNum, reqVO.getEmployeeCardNum())
                .eqIfPresent(DeliveryPersonInfoDO::getAddress, reqVO.getAddress())
                .eqIfPresent(DeliveryPersonInfoDO::getType, reqVO.getType())
                .eqIfPresent(DeliveryPersonInfoDO::getStatus, reqVO.getStatus())
                .eqIfPresent(DeliveryPersonInfoDO::getReceiveOrderStatus, reqVO.getReceiveOrderStatus())
                .eqIfPresent(DeliveryPersonInfoDO::getSystemUserId, reqVO.getSystemUserId())
                .eqIfPresent(DeliveryPersonInfoDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(DeliveryPersonInfoDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(DeliveryPersonInfoDO::getUpdater, reqVO.getUpdater())
                .orderByDesc(DeliveryPersonInfoDO::getId));
    }

}